<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>社区页</title>

		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!-- 引入css文件 -->
		<link rel="stylesheet" href="../css/sm.min.css">
		<link rel="stylesheet" href="../css/sm-extend.min.css">
		<link rel="stylesheet" href="../css/iconfont.css">

		<script src='../js/vue.js'></script>
		<script src='../js/axios.min.js'></script>
		<script src='../js/jquery-3.2.1.min.js'></script>
		<script src="../js/config.js"></script>
		<style type="text/css">
			/* 卡片内容加边距 */
			.my-cont {
				padding: .2rem .75rem;
			}
			/* 背景色白色 */
			.page,
			.page-group {
				background-color: white;
			}
			/* 去掉卡片边距 */
			.card {
				margin: 0;
			}

			.page {
				/* margin: 0.2rem; */
			}

			/* 用户字体 */
			.list-block .my-user {
				font-size: 0.6rem;
				color: rgb(150, 150, 150);
			}

			.list-block .media-list .item-title{
				font-size: 0.7rem;
				font-weight: 700;
			}
			/* 头像圆角 */
			.my-photo img {
				border-radius: 1rem;
			}

			/* 卡片主内容左右边距 */
			.my-data {
				position: static;
				border-bottom: 1px solid rgb(220, 220, 220);
				padding-right: 60%;
				padding-left: 1rem;
			}

			/* 顶部社区样式 */
			/* 最外层 */
			.content {
				/* background-color: #3d005f; */
			}

			.my-top {
				/* height: 10rem; */
				background-color: #9db709;
				padding: 1rem 0.5rem;
				padding-top: 0.3rem;
			}

			/* 搜索顶部工具栏 */
			#my-top-find {
				height: 1.5rem;
			}

			#my-top-find>div {
				float: right;
				height: 100%;
				text-align: center;
				line-height: 1.5rem;
			}

			#return span {
				color: white;
			}

			/* 返回 */
			#my-top-find #return {
				position: absolute;
				height: 1.5rem;
			}

			/* 头像和简介外框 */
			#my-top-forum {
				margin-top: 0.3rem;
				height: 3rem;
			}

			#my-top-forum>div {
				float: left;
				height: 100%;
				color: white;
			}

			/* 社区头像 */
			#my-top-img {
				width: 3rem;
				height: 100%;
				border-radius: 1rem;
				overflow: hidden;
				margin-right: 1rem;
			}

			/* 社区头像内图片 */
			#my-top-img img {
				width: 100%;
				height: 100%;
			}

			/*  */
			#forumIntr {
				width: 70%;
			}

			/* 社区信息 */
			#my-top-name {
				width: 13rem;
				height: 1.5rem;
				line-height: 3rem;
				font-size: 0.9rem;
				font-weight: 700;
			}
			/* popup遮罩异常 */
			.modal-overlay.modal-overlay-visible,
			.popup-overlay.modal-overlay-visible,
			.preloader-indicator-overlay.modal-overlay-visible {
				visibility: hidden;
			}


			.imgDel {
				position: absolute;
				top: 0.2rem;
				right: 0.32rem;
				font-size: 0.8rem;
			}

			/* 图片添加 */
			#addImg {
				position: absolute;
				opacity: 0;
				width: 100%;
				height: 100%;
			}
			a{
				color: inherit;
			}
			a:active{
				color: inherit;
			}
			/* 赞，回复数字 */
			.numType{
				font-size: 0.7rem;
				padding-right: 0.2rem;
				position: relative;
				top: 0.1rem;
			}
			/* 用户头像 */
			.user-photo img {
				/* width: 2rem;
				height: 2rem; */
				border-radius: 1rem;
			}
			/* tab1 */
			#tab1 .list-block{
				margin-top: 0;
				padding: 1.2rem;
			}
			.titles{
				font-size: 0.9rem;
			}
			/* 弹框左间距 */
			#alter ul li>div{
				padding-left: 0;
			}
			.popup textarea{
				font-size: 0.7rem;
			}
			/* 弹窗主体 */
			.popup,#alter ul{
				background-color: #f2fff2;
			}
			/* 弹窗头像input */
			#alterImg{
				    position: absolute;
				    opacity: 0;
				    width: 100%;
				    height: 100%;
			}
			.card-footer{
				border-bottom: 1px solid #dcdcdc;
			}
			.card-footer:before{
				content: none;
			}
			.card-footer{
				margin-bottom: 1rem;
			}
		</style>
		<style type="text/css">
			.infinite-scroll-preloader {
				margin-top: -20px;
			}
		</style>
	</head>
	<body>
		<!-- page 容器 -->
		<div class="page">
			<!-- 这里是页面内容区 -->
			<div class="content">
				<!-- 顶部区域 -->
				<div class="my-top">
					<!-- 顶部搜索栏 -->
					<div id="my-top-find">
						<div @click="returns" id="return">
							<a href="#">
								<span class="iconfont icon-fanhui"></span>
							</a>
						</div>
					</div>
					<!-- 社区展示 -->
					<div id="my-top-forum">
						<!-- 头像 -->
						<div id="my-top-img" v-if="forumForum!=null">
							<img :src="imgSrc(forumForum.forum.photo)">
						</div>
						<!-- 介绍 -->
						<div id="forumIntr">
							<div id="my-top-name" v-if="forumForum!=null">
								{{forumForum.forum.name}}
							</div>
						</div>
					</div>
				</div>
				<!-- 标题栏 -->
				<div class="buttons-tab fixed-tab" data-offset="0">
					<a href="#tab1" class="tab-link active button">社区信息</a>
					<a href="#tab2" class="tab-link button">话题举报</a>
					<a href="#tab3" class="tab-link button">回复举报</a>
				</div>
				
				<div class="tabs">
					<!-- 主内容 -->
					<div id="tab1" class="tab active" data-distance="50">
						<div class="list-block" v-if="forumForum!=null">
							<!-- 简介 -->
							<div id="">
								<div style="height: 1.5rem;">
									<span class="titles" >
										简介：
									</span>
								</div>
								<div style="height: 4rem; font-size: 0.7rem;">
									<span id="">
										{{forumForum.forum.intro}}
									</span>
								</div>
							</div>
							<!-- 公告 -->
							<div>
								<div style="height: 1.5rem;">
									<span  class="titles">
										公告：
									</span>
								</div>
								<div  style="height: 4rem; font-size: 0.7rem;">
									<span>
										{{forumForum.forum.notice}}
									</span>
								</div>
							</div>
							<!-- 地址 -->
							<div  style="height: 2rem; ">
								<span  class="titles">
									地址：
								</span>
								<span id="">
									{{forumForum.forum.address}}
								</span>
							</div>
							<!-- 电话 -->
							<div  style="height: 2rem; ">
								<span class="titles">
									电话：
								</span>
								<span id="">
									{{forumForum.forum.phone}}
								</span>
							</div>
							<div class="content-block" style="width: 5rem; padding-left: 0;">
							    <p><a href="#" class="open-popup button button-round">修改</a></p>
							</div>
						</div>
					</div>
					
					<!-- 话题举报 -->
					<div id="tab2" class="tab infinite-scroll2" data-distance="50">
						<div class="list-block">
							<div class="card list-container ">
					
								<!-- 举报信息 -->
								<!-- <div class="card-content">
									<div class="list-block media-list">
										<ul>
											<li class="item-content">
												<div class="item-media my-photo">
													<img src="http://gqianniu.alicdn.com/bao/uploaded/i4//tfscom/i3/TB10LfcHFXXXXXKXpXXXXXXXXXX_!!0-item_pic.jpg_250x250q60.jpg"
													 width="35">
												</div>
												<div class="item-inner">
													<div class="item-title-row">
														<div class="item-title">张三</div>
													</div>
													<div class="item-subtitle my-user">
														12：50
													</div>
												</div>
											</li>
										</ul>
									</div>
								</div>
								!-- 原话题 --
								<div class="my-cont">
									<div id="" style="border: rgb(170, 170, 170) 1px solid; border-radius: 0.5rem; padding: 0.2rem;">
										<span style="font-size: 0.6rem;color: rgb(222, 144, 0);">
											@李四
										</span>
										<span style="font-size: 0.7rem;color: rgb(121, 121, 121);">
											话题安达市大所大所多安达市大所大所多安达市安达市大所大所多安达市大所大所多安达市大所大所多安达市大所大所多<br>
										</span>
									</div>
									!-- 原因 --
									<div id="" style="margin-top: 0.2rem;">
										<span>
											说话太粗路了
										</span>
									</div>
								</div>
								<div class="card-footer">
									<span style=" margin-right: 3rem; width: 5rem; font-size: 0.8rem;">
										审核结果：
									</span>
									<span>
										<span class="icon iconfont icon-tongguo" style="font-size: 2rem; color:rgb(79,208,140);"></span>
									</span>
									<span style="margin-right: 0.5rem;">
										<span class="icon iconfont icon-weitongguo" style="font-size: 2rem;color:rgb(216,30,6);"></span>
									</span>
								</div> -->
								
							</div>
						</div>
						<!-- 加载提示符 -->
						<div class="infinite-scroll-preloader2">
							<div class="preloader"></div>
						</div>
					</div>
					
					<!-- 回复举报 -->
					<div id="tab3" class="tab infinite-scroll" data-distance="50">
						<div class="list-block">
							<div class="card list-container ">
					
								<!-- 举报信息 -->
								<!-- <div class="card-content">
									<div class="list-block media-list">
										<ul>
											<li class="item-content">
												<div class="item-media my-photo">
													<img src="http://gqianniu.alicdn.com/bao/uploaded/i4//tfscom/i3/TB10LfcHFXXXXXKXpXXXXXXXXXX_!!0-item_pic.jpg_250x250q60.jpg"
													 width="35">
												</div>
												<div class="item-inner">
													<div class="item-title-row">
														<div class="item-title">张三</div>
													</div>
													<div class="item-subtitle my-user">
														12：50
													</div>
												</div>
											</li>
										</ul>
									</div>
								</div>
								!-- 原因 --
								<div class="my-cont">
									<span>
										回复安达市大所大所多安达市大所大所多安达市安达市大所大所多安达市大所大所多安达市大所大所多安达市大所大所多<br>
									</span>
									!-- 原话题 --
									<div id="">
										<span>
											654646464664
										</span>
									</div>
								</div>
								<div class="card-footer my-data">
									<span>举报成立
										<span class="icon iconfont icon-appreciate"></span>
									</span>
									<span>不成立
										<span class="icon iconfont icon-message"></span>
									</span>
								</div> -->
					
							</div>
						</div>
						<!-- 加载提示符 -->
						<div class="infinite-scroll-preloader">
							<div class="preloader"></div>
						</div>
					</div>
				</div>
			</div>
			
			<!-- popup -->
			<div class="popup">
				<div class="content-block" style="margin-top: 0.5rem;">
					<!-- 工具栏 -->
					<div class="addTopic-top row">
						<div class="t1 col-33">
							<span class="close-popup iconfont icon-fanhui"></span>
						</div>
						<div class="t2 col-33" style="font-size: 0.8rem;">
							<span>社区信息修改</span>
						</div>
					</div>
					<div v-if="forumForum!=null" id="alter" class="item-content list-block">
						
						<ul>
						      <!-- Text inputs -->
							  <li class="align-top">
							    <div class="item-content">
							  	<div class="item-media"><i class="icon icon-form-comment"></i></div>
							  	<div class="item-inner">
							  	  <div class="item-title label">头像</div>
							  	  <div class="item-input">
									  <div id="" style="height: 3.5rem; width: 3.5rem;">
										  <form id="imgForm" method="post" enctype="multipart/form-data">
										  	<input id="alterImg" name="img" type="file" @change="addImgMethod" accept="image/jpeg" />
										  </form>
									  	<img id="forumPhothShow" :src="imgSrc(img)" style="height: 100%; width: 100%;border-radius: 0.7rem;">
									  </div>
							  	  </div>
							  	</div>
							    </div>
							  </li>
							  <form id="subMes">
						      <li>
						        <div class="item-content">
						          <div class="item-media"><i class="icon icon-form-name"></i></div>
						          <div class="item-inner">
						            <div class="item-title label">社区名称</div>
						            <div class="item-input">
						              <input id="name" name="name" maxlength="20" v-model="name" type="text" placeholder="请输入名称">
										<input type="hidden" name="id" :value="forumForum.forum.id" />
						            </div>
						          </div>
						        </div>
						      </li>
							  <li>
							    <div class="item-content">
							      <div class="item-media"><i class="icon icon-form-name"></i></div>
							      <div class="item-inner">
							        <div class="item-title label">电话</div>
							        <div class="item-input">
							          <input id="phone" name="phone" maxlength="11" v-model="phone" type="text" placeholder="请输入号码">
							        </div>
							      </div>
							    </div>
							  </li>
							<li class="align-top">
							  <div class="item-content">
								<div class="item-media"><i class="icon icon-form-comment"></i></div>
								<div class="item-inner">
								  <div class="item-title label">地址</div>
								  <div class="item-input">
									<textarea id="address" name="address" v-model="address" maxlength="200"></textarea>
								  </div>
								</div>
							  </div>
							</li>
							 <li class="align-top">
							  <div class="item-content">
								<div class="item-media"><i class="icon icon-form-comment"></i></div>
								<div class="item-inner">
								  <div class="item-title label">简介</div>
								  <div class="item-input">
									<textarea id="intro" name="intro" maxlength="50">{{forumForum.forum.intro}}</textarea>
								  </div>
								</div>
							  </div>
							</li>
							<li class="align-top">
							  <div class="item-content">
								<div class="item-media"><i class="icon icon-form-comment"></i></div>
								<div class="item-inner">
								  <div class="item-title label">公告</div>
								  <div class="item-input">
									<textarea id="notice" name="notice" maxlength="200">{{forumForum.forum.notice}}</textarea>
								  </div>
								</div>
							  </div>
							</li>
						</form>
						</ul>
					</div>
					<p><a href="#" @click="subMitForum" class="button button-big button-round">保存</a></p>
					</div>
				</div>
			</div>
		</div>
		<script src='../js/sm.js'></script>
		<script src='../js/sm-extend.js'></script>

		<script>
			/* 获取请求参数 */
			function getUrlParam(name) {
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
				var r = window.location.search.substr(1).match(reg); //匹配目标参数
				if (r != null) return unescape(r[2]);
				return null; //返回参数值
			}
			var forumId = getUrlParam('forumId');
			//绑定vue
			var app = new Vue({
				el: ".page",
				data: {
					forumForum: null,
					img: "",
					name:"",
					phone:"",
					address:""
				},
				created() {
					/* 加载数据 */
					this.ajax();
				},
				methods: {
					/* 头像 */
					ajax: function() {
						axios.get(serviceIP+"/forum/comIntroduce?forumId=" + forumId,{headers:{"token":token,"refreshtoken":refreshtoken}}).then(result => {
							this.forumForum = result.data.data;
							this.img=result.data.data.forum.photo;
							this.name=result.data.data.forum.name;
							this.phone=result.data.data.forum.phone;
							this.address=result.data.data.forum.address;
						});
					},
					imgSrc: function(src) {
						return src;
					},
					/* 更换照片 */
					addImgMethod: function() {
						var path=$("#alterImg").val();
						if(path!=null&&path!=""){
							var that = this;
							$.ajax({
								url: serviceIP+"/forum/addImg",
								type: "post",
								dataType: "json",
								cache: false,
								data: new FormData($("#imgForm")[0]),
								headers: {
											"token":token,
											"refreshtoken":refreshtoken
										},
								processData: false, // 不处理数据
								contentType: false, // 不设置内容类型
								success: function(data) {
									that.img=data.url;
								}
							});
						}
					},
					//提交
					subMitForum: function() {
						if(this.chech()){
							var data=$("#subMes").serialize();
							data+="&photo="+this.img;
							axios.get(serviceIP+"/forum/submitForum?"+data,{headers:{"token":token,"refreshtoken":refreshtoken}}).then(result => {
								if(result.data==1){
									$.toast("已修改");
									//更新数据
									this.ajax();
									$.closeModal(".popup");
								}else{
									$.toast("失败，系统维护中");
								}
							});
						}
					},
					//表单验证
					chech: function() {
						if(this.name.length<3){
							$.toast("名称太短了");
							return false;
						}
						if(this.phone.length!=11){
							$.toast("电话为11位");
							return false;
						}
						if(this.address.length<10){
							$.toast("地址太短了");
							return false;
						}
						return true;
					},
					//返回
					returns: function() {
						window.history.go(-1);
						//location.href = "forum-index.html";
					}
				}
			});
		</script>

		<script>
			// 加载flag
			var loading = false;
			// 最多可加载的条目
			var maxItems = 100;
			// 每次加载添加多少条目
			var itemsPerLoad = 5;
			// 初始页
			var lastIndex = 1;
			// 生成新条目的HTML
			function inform(inform) {
				
				var html ='<div class="card-content">'
					+'<div class="list-block media-list">'
				+'		<ul>'
				+'			<li class="item-content">'
				+'				<div class="item-media my-photo">'
				+'<a href="forum-other-centre.html?userId='+inform.user.id+'"><img src="'+inform.user.photo+'"'
				+'					 width="35" height="35"></a>'
				+'				</div>'
				+'				<div class="item-inner">'
				+'					<div class="item-title-row">'
				+'						<div class="item-title">'+inform.user.nickname+'</div>'
				+'					</div>'
				+'					<div class="item-subtitle my-user">';
				
				// 判断日期时间
				var num = new Date().getTime() - Date.parse(inform.forumTopicReport.date);
				var date = new Date(Date.parse(inform.forumTopicReport.date));
				//一小时以内
				if (num < 3600000) {
					html += '<span>' + Math.ceil(num / 60000) + '分钟前</span>';
				} else if (date.setHours(0, 0, 0, 0) == new Date().setHours(0, 0, 0, 0)) {
					//今天发送的
					html += '<span>' + inform.forumTopicReport.date.substring(11, 16) + '</span>';
				} else {
					//之前的信息
					html += '<span>' + inform.forumTopicReport.date.substring(0, 10) + '</span>';
				}
				
				html +='					</div>'
				+'				</div>'
				+'			</li>'
				+'		</ul>'
				+'	</div>'
				+'</div>'
				+'<div class="my-cont">'
				+'	<div id="" style="border: rgb(170, 170, 170) 1px solid; border-radius: 0.5rem; padding: 0.2rem;">'
				+'		<span style="font-size: 0.6rem;color: rgb(222, 144, 0);">'
				+'			@'+inform.reportUser.nickname
				+'		</span>'
				+'		<a href="forum-Topic.html?topicId='+inform.forumTopic.id+'"><span style="font-size: 0.7rem;color: rgb(121, 121, 121);">'
				+			inform.forumTopic.content+'<br>'
				+'		</span></a>'
				+'	</div>'
				+'	<!-- 原因 -->'
				+'	<div id="" style="margin-top: 0.2rem;">'
				+'		<span>'
				+		inform.forumTopicReport.reason
				+'		</span>'
				+'	</div>'
				+'</div>'
				+'<div class="card-footer">'
				+'	<span style="font-weight: 600; margin-right: 3rem; width: 5rem; font-size: 0.8rem;">'
				+'		审核结果：'
				+'	</span>'
				+'	<span onclick=topicAudit(\''+inform.forumTopicReport.id+'\',1)>'
				+'		<span class="icon iconfont icon-tongguo" style="font-size: 2rem; color:rgb(79,208,140);"></span>'
				+'	</span>'
				+'	<span style="margin-right: 0.5rem;"  onclick=topicAudit(\''+inform.forumTopicReport.id+'\',0)>'
				+'		<span class="icon iconfont icon-weitongguo" style="font-size: 2rem;color:rgb(216,30,6);"></span>'
				+'	</span>'
				+'</div>';
				

				// 添加新条目
				$('#tab2 .list-container').append(html);
			}
			//异步请求封装
			function aja() {
				// 如果正在加载，则退出
				if (loading) return;
				// 设置flag
				loading = true;
				//请求加载信息
				$.ajax({
					type: 'get',
					url: serviceIP+"/forum/topicTnform",
					dataType: 'json',
						data:{
							page: lastIndex,
							limit: itemsPerLoad,
							forumId:forumId
						},
					headers: {
							"token":token,
							"refreshtoken":refreshtoken
						},
					success:function (data) {
						// 重置加载flag
						loading = false;
						//页面遍历添加
						$.each(data.data.list, function(i, item) {
							inform(item);
						});
						// 更新最后加载的序号
						lastIndex++;
						//无数据
						if (data.data.size < itemsPerLoad) {
							// 删除加载提示符
							$('.infinite-scroll-preloader2').remove();
						}
						if (data.data.size < 1) {
							// 加载完毕，则注销无限加载事件，以防不必要的加载
							$.detachInfiniteScroll($('.infinite-scroll2'));
							// 删除加载提示符
							$('.infinite-scroll-preloader2').remove();
							//提醒
							$.toast("无更多举报信息！");
							return;
						}
						//容器发生改变,如果是js滚动，需要刷新滚动
						$.refreshScroller();
					}
				});
			}
			// 注册'infinite'事件处理函数
			$(document).on('infinite', function() {
				aja();
			});
			aja();
		</script>
		<!-- 回复举报的加载 -->
		<script>
			// 加载flag
			var loading3 = false;
			// 最多可加载的条目
			var maxItems = 100;
			// 每次加载添加多少条目
			var itemsPerLoad3 = 5;
			// 初始页
			var lastIndex3 = 1;
			// 生成新条目的HTML
			function inform3(inform) {
				
				var html ='<div class="card-content">'
					+'<div class="list-block media-list">'
				+'		<ul>'
				+'			<li class="item-content">'
				+'				<div class="item-media my-photo">'
				+'<a href="forum-other-centre.html?userId='+inform.user.id+'"><img src="'+inform.user.photo+'"'
				+'					 width="35" height="35"></a>'
				+'				</div>'
				+'				<div class="item-inner">'
				+'					<div class="item-title-row">'
				+'						<div class="item-title">'+inform.user.nickname+'</div>'
				+'					</div>'
				+'					<div class="item-subtitle my-user">';
				
				// 判断日期时间
				var num = new Date().getTime() - Date.parse(inform.forumReplyReport.date);
				var date = new Date(Date.parse(inform.forumReplyReport.date));
				//一小时以内
				if (num < 3600000) {
					html += '<span>' + Math.ceil(num / 60000) + '分钟前</span>';
				} else if (date.setHours(0, 0, 0, 0) == new Date().setHours(0, 0, 0, 0)) {
					//今天发送的
					html += '<span>' + inform.forumReplyReport.date.substring(11, 16) + '</span>';
				} else {
					//之前的信息
					html += '<span>' + inform.forumReplyReport.date.substring(0, 10) + '</span>';
				}
				
				html +='					</div>'
				+'				</div>'
				+'			</li>'
				+'		</ul>'
				+'	</div>'
				+'</div>'
				+'<div class="my-cont">'
				+'	<div id="" style="border: rgb(170, 170, 170) 1px solid; border-radius: 0.5rem; padding: 0.2rem;">'
				+'		<span style="font-size: 0.6rem;color: rgb(222, 144, 0);">'
				+'			@'+inform.reportUser.nickname
				+'		</span>'
				+'		<a href="forum-Topic.html?topicId='+inform.forumReply.topicId+'"><span style="font-size: 0.7rem;color: rgb(121, 121, 121);">'
				+			inform.forumReply.content+'<br>'
				+'		</span></a>'
				+'	</div>'
				+'	<!-- 原因 -->'
				+'	<div id="" style="margin-top: 0.2rem;">'
				+'		<span>'
				+		inform.forumReplyReport.reason
				+'		</span>'
				+'	</div>'
				+'</div>'
				+'<div class="card-footer">'
				+'	<span style="font-weight: 600; margin-right: 3rem; width: 5rem; font-size: 0.8rem;">'
				+'		审核结果：'
				+'	</span>'
				+'	<span onclick=replyAudit(\''+inform.forumReplyReport.id+'\',1)>'
				+'		<span class="icon iconfont icon-tongguo" style="font-size: 2rem; color:rgb(79,208,140);"></span>'
				+'	</span>'
				+'	<span style="margin-right: 0.5rem;"  onclick=replyAudit(\''+inform.forumReplyReport.id+'\',0)>'
				+'		<span class="icon iconfont icon-weitongguo" style="font-size: 2rem;color:rgb(216,30,6);"></span>'
				+'	</span>'
				+'</div>';
				
		
				// 添加新条目
				$('#tab3 .list-container').append(html);
			}
			//异步请求封装
			function aja3() {
				// 如果正在加载，则退出
				if (loading3) return;
				// 设置flag
				loading3 = true;
				//请求加载信息
				$.ajax({
					type: 'get',
					url: serviceIP+"/forum/replyInform",
					dataType: 'json',
						data:{
							page: lastIndex3,
							limit: itemsPerLoad3,
							forumId:forumId
						},
					headers: {
							"token":token,
							"refreshtoken":refreshtoken
						},
					success:function (data) {
						// 重置加载flag
						loading3 = false;
						//页面遍历添加
						$.each(data.data.list, function(i, item) {
							inform3(item);
						});
						// 更新最后加载的序号
						lastIndex3++;
						//无数据
						if (data.data.size < itemsPerLoad3) {
							// 删除加载提示符
							$('.infinite-scroll-preloader').remove();
						}
						if (data.data.size < 1) {
							// 加载完毕，则注销无限加载事件，以防不必要的加载
							$.detachInfiniteScroll($('.infinite-scroll'));
							// 删除加载提示符
							$('.infinite-scroll-preloader').remove();
							//提醒
							$.toast("无更多举报信息！");
							return;
						}
						//容器发生改变,如果是js滚动，需要刷新滚动
						$.refreshScroller();
					}
				});
			}
			// 注册'infinite'事件处理函数
			$(document).on('infinite', function() {
				aja3();
			});
			aja3();
		</script>
		
		<script type="text/javascript">
			//话题审核结果
			 function topicAudit(informId,status){
				$.ajax({
						type: 'get',
						url: serviceIP+"/forum/checkTopicInform",
						dataType: 'json',
							data:{
								informId: informId,
								status: status
							},
						headers: {
								"token":token,
								"refreshtoken":refreshtoken
							},
						success:function (data) {
						if(data.data == 1){
							$.toast("审核完成");
							lastIndex = 1;
							$('.infinite-scroll2 .list-container').html("");
							$.attachInfiniteScroll($('.infinite-scroll2'));
							aja();
						}else{
							$.toast("失败，系统维护中");
						}
					}});
			} 
			//回复审核结果
			 function replyAudit(informId,status){
				 
							$.ajax({
								type: 'get',
								url: serviceIP+"/forum/checkReplyInform",
								dataType: 'json',
									data:{
										informId: informId,
										status: status
									},
								headers: {
										"token":token,
										"refreshtoken":refreshtoken
									},
								success:function (data) {
						if(data.data == 1){
							$.toast("审核完成");
							lastIndex3 = 1;
							$('.infinite-scroll .list-container').html("");
							$.attachInfiniteScroll($('.infinite-scroll'));
							aja3();
						}else{
							$.toast("失败，系统维护中");
						}
					}});
			} 
		</script>
		<script>
			$.init();
		</script>
	</body>

</html>
